package com.grgbanking.it.wx.entity;

import java.util.Date;
import java.util.Map;

import com.grgbanking.it.wx.common.WXConstant;

/**
 * 被动信息 包括接收到的信息及被接收到信息后回复被动回复的信息 XML格式
 * 
 * WXRecivedMessage
 * 
 * @author 潘广伟
 * @Email p_3er@qq.com
 * @Date 2014-11-6 下午2:19:35
 * 
 * @version 1.0.0
 * 
 */
public class WXPassiveMessage {
	/**
	 * 企业号CorpID
	 */
	private String ToUserName;
	/**
	 * 员工UserID
	 */
	private String FromUserName;
	/**
	 * 消息创建时间（整型）
	 */
	private Long CreateTime;
	/**
	 * 消息类型
	 */
	private String MsgType;
	/**
	 * 文本消息内容
	 */
	private String Content;
	/**
	 * 消息id，64位整型
	 */
	private String MsgId;
	/**
	 * 企业应用的id
	 */
	private Integer AgentID;
	/**
	 * 图片地址
	 */
	private String PicUrl;
	
	public WXPassiveMessage(Integer agentId){
		this.setFromUserName(WXConstant.CORPID);
		this.setAgentID(agentId);
		this.setCreateTime(new Date().getTime());
		this.setMsgType(WXConstant.RESP_MESSAGE_TYPE_TEXT);
	}


	public WXPassiveMessage(Map<String, String> map) {
		this.ToUserName = map.get("ToUserName");
		this.FromUserName = map.get("FromUserName");
		this.CreateTime = Long.valueOf(map.get("CreateTime"));
		this.MsgType = map.get("MsgType");
		this.Content = map.get("Content");
		this.MsgId = map.get("MsgId");
		this.AgentID = Integer.valueOf(map.get("AgentID"));
		this.PicUrl = map.get("PicUrl");
	}

	public String getToUserName() {
		return ToUserName;
	}

	public void setToUserName(String toUserName) {
		ToUserName = toUserName;
	}

	public String getFromUserName() {
		return FromUserName;
	}

	public void setFromUserName(String fromUserName) {
		FromUserName = fromUserName;
	}

	public Long getCreateTime() {
		return CreateTime;
	}

	public void setCreateTime(Long createTime) {
		CreateTime = createTime;
	}

	public String getMsgType() {
		return MsgType;
	}

	public void setMsgType(String msgType) {
		MsgType = msgType;
	}

	public String getContent() {
		return Content;
	}

	public void setContent(String content) {
		Content = content;
	}

	public String getMsgId() {
		return MsgId;
	}

	public void setMsgId(String msgId) {
		MsgId = msgId;
	}

	public Integer getAgentID() {
		return AgentID;
	}

	public void setAgentID(Integer agentID) {
		AgentID = agentID;
	}

	public String getPicUrl() {
		return PicUrl;
	}

	public void setPicUrl(String picUrl) {
		PicUrl = picUrl;
	}

}
